<?php
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $this yii\web\view */
/* @var $emails common\models\Email[] */

$this->title = 'Email';
$this->params['breadcrumbs'][] = $this->title;
?>
<h2 class="page-header"><?= Html::encode($this->title) ?></h2>

<p>
    <a href="<?= Url::to(['create']) ?>" class="btn btn-info">
        <span class="glyphicon glyphicon-send"></span> Send Email
    </a>
</p>

<table class="table">
    <thead>
    <tr>
        <th>收件人</th>
        <th>Email</th>
        <th>标题</th>
        <th>内容</th>
        <th></th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ($emails as $email): ?>
        <tr>
            <td><?= $email->receiver_name ?></td>
            <td><?= $email->receiver_email ?></td>
            <td><?= $email->subject ?></td>
            <td><?= $email->content ?></td>
            <td>
                <a href="<?= Url::to(['email/delete', 'id' => $email->id]) ?>" data-method="post"
                   data-confirm="确认要删除此封邮件吗？">
                    <span class="glyphicon glyphicon-trash"></span>
                </a>
            </td>
        </tr>
    <?php endforeach ?>
    </tbody>
</table>